package com.yn.common.request.zy;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.yn.common.model.zy.TDoctorInfoDO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "医生信息新增请求对象", description = "用于接收前端新增医生信息的请求数据")
public class DoctorAddRequest {

    @ApiModelProperty(value = "医生id")
    private Integer id;

    @ApiModelProperty(value = "医生名字")
    @NotBlank(message = "医生名字不能为空")
    private String doctorName;

    @ApiModelProperty(value = "医生头像")
    @NotBlank(message = "医生头像不能为空")
    private String headImageUrl;

    @ApiModelProperty(value = "医生职称【筛选条件】")
    @NotBlank(message = "医生职称不能为空")
    private String doctorLever;

    @ApiModelProperty(value = "学历")
    @NotBlank(message = "学历不能为空")
    private String education;

    @ApiModelProperty(value = "专业领域")
    @NotBlank(message = "专业领域不能为空")
    private String professionalField;

    @ApiModelProperty(value = "介绍")
    @NotBlank(message = "介绍不能为空")
    private String doctorIntro;


    @ApiModelProperty(value = "微信")
    private String weChat;

    @ApiModelProperty(value = "地区")
    @NotBlank(message = "地区不能为空")
    private String belongingRegion;

   /* @ApiModelProperty(value = "医院")
    @NotBlank(message = "医院不能为空")
    private String belongingHospital;*/

    @ApiModelProperty(value = "电话")
    @NotBlank(message = "电话不能为空")
    private String phoneNumber;

    @ApiModelProperty(value = "医生类型(1:坐诊 2:住院)")
    @NotBlank(message = "医生类型不能为空")
    private String dockerTypes;

    @ApiModelProperty(value = "机构id")
    @NotNull(message = "机构id不能为空")
    private Integer organInfoId;


    @ApiModelProperty(value = "所属科室id")
    @NotNull(message = "所属科室id不能为空")
    private List<Integer> belongingDepartmentIds;


    public static TDoctorInfoDO transform(DoctorAddRequest request){
        if (ObjectUtils.isEmpty(request)) {
            return null;
        }
        TDoctorInfoDO tDoctorInfoDO = new TDoctorInfoDO();
        BeanUtil.copyProperties(request, tDoctorInfoDO);
        return tDoctorInfoDO;
    }

}